/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import com.opensymphony.xwork2.validator.annotations.EmailValidator;
import com.opensymphony.xwork2.validator.annotations.IntRangeFieldValidator;
import com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;
import com.opensymphony.xwork2.validator.annotations.Validations;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 *
 * @author Trang
 */
public class Request implements Serializable{
    private Integer idRequest;
    private Staff staff1;
    private Staff staff2;
    private Staff staff3;
    private String reason;
    private String approach;
    private String status;
    private Date createDate;
    private Product product;
    private int quantity;

    public Request(Staff staff1, Staff staff2, String reason, Product product, int quantity) {
        this.staff1 = staff1;
        this.staff2 = staff2;
        this.reason = reason;
        this.product = product;
        this.quantity = quantity;
    }

    
    
    public Request(Integer idRequest, Staff staff1, String approach, String status, Date createDate) {
        this.idRequest = idRequest;
        this.staff1 = staff1;
        this.approach = approach;
        this.status = status;
        this.createDate = createDate;
    }

    
    public Request(Integer idRequest, Staff staff1, String reason, Product product, int quantity) {
        this.idRequest = idRequest;
        this.staff1 = staff1;
        this.reason = reason;
        this.product = product;
        this.quantity = quantity;
    }

    public Request(Integer idRequest, Staff staff1, String reason, Product product, int quantity, Date createDate) {
        this.idRequest = idRequest;
        this.staff1 = staff1;
        this.reason = reason;
        this.product = product;
        this.quantity = quantity;
        this.createDate = createDate;
    }
    
    public Request()
    {
        
    }
    public Request(Integer idRequest, Staff staff1, Staff staff2, Staff staff3, String reason, String approach, String status, Date createDate, Product product, int quantity) {
        this.idRequest = idRequest;
        this.staff1 = staff1;
        this.staff2 = staff2;
        this.staff3 = staff3;
        this.reason = reason;
        this.approach = approach;
        this.status = status;
        this.createDate = createDate;
        this.product = product;
        this.quantity = quantity;
    }

    
    
    public int getQuantity() {
        return quantity;
    }

//     @Validations(
//            requiredStrings = {
//        @RequiredStringValidator(message = "Quantity is required.")},
//            intRangeFields = {@IntRangeFieldValidator(message = "Invalid Quantity", min = "1", max = "10")}
//             )
      @RequiredStringValidator(message = "Quantity is required.")
//            emails = {
//        @EmailValidator(message = "Invalid E-mail")})
    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }
    
    


    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }
    

    public Integer getIdRequest() {
        return idRequest;
    }

    public void setIdRequest(Integer idRequest) {
        this.idRequest = idRequest;
    }

    public Staff getStaff1() {
        return staff1;
    }

    public void setStaff1(Staff staff1) {
        this.staff1 = staff1;
    }

    public Staff getStaff2() {
        return staff2;
    }

    public void setStaff2(Staff staff2) {
        this.staff2 = staff2;
    }

    public Staff getStaff3() {
        return staff3;
    }

    public void setStaff3(Staff staff3) {
        this.staff3 = staff3;
    }

    public String getReason() {
        return reason;
    }

    @RequiredStringValidator(message = "Reason is required.")
    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getApproach() {
        return approach;
    }

    public void setApproach(String approach) {
        this.approach = approach;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }
    
}
